package cn.laixueit.api;

import cn.laixueit.cart.pojo.item.Sku;
import cn.laixueit.cart.pojo.item.Spu;
import cn.laixueit.cart.pojo.item.SpuDetail;
import cn.laixueit.cart.pojo.item.SpuVo;
import cn.laixueit.cart.pojo.page.PageResult;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface GoodsApi {
    @GetMapping("/sku/list")
    public ResponseEntity<List<Sku>> list(@RequestParam("id") Long id);

    @GetMapping("/spu/detail/{id}")
    public ResponseEntity<SpuDetail> detail(@PathVariable("id")Long id);

    @GetMapping("/spu/page")
    public ResponseEntity<PageResult<SpuVo>> page(@RequestParam(value = "key",required = false)String key,
                                                  @RequestParam(value = "saleable",required = false) Boolean saleable,
                                                  @RequestParam(value = "page",required = true)Integer page,
                                                  @RequestParam(value = "rows",required = true)Integer rows);

    @GetMapping("/spu/{id}")
    public ResponseEntity<Spu> getSpuById(@PathVariable("id")Long id);

    @GetMapping("/sku/{id}")
    public ResponseEntity<Sku> getSkuById(@PathVariable("id")Long id);

}
